7.1 Introduction

  1. Motivations
    • Web documents (oac client-side web programs) are fetched from a web server system, and they are displayed on web browers.
    • Web documents (oac client-side web programs) are texts, not compiled machine code. Why?
    • Web documents (oac client-side web programs) need programming logic to respond to events to support user interactions.
    • JavaScript is a programming language to support the above programming logic. There is only one at the client-side, but there are multiple programming languages at the server-side.
    • A web document (orc web app) consitst of HTML5, CSS3, and JavaScript. Is JavaScript code compiled or text?
    • Example of drop-down menu and modal windows - Do you think you can write the code only with HTML5 and CSS3?
        • Sign In
        • Join
        • Forgot Password
    • How to learn?
      Learn by examples - Because you learned a programming language, you know basic programming syntaxes and have problem solving skill. You don't have to learn JavaSript from the scratch.
  2. Comparison between JavaScript and Java
    • They are different programming languages.
    • JavaScriptJava
      Multiple files?Generally, noYes
      Compilation required?No (Code will be interpreted.)Yes
      Scripting language?YesNo
      PlatformWeb browsersJVM/OS
      Programming style?SequentialObject-oriented
      Event-driven programming?YesPossible
      Use of objects?Yes, but no classYes
      Modula programming?Functions; objects and methodsClasses; objects and methods
      Difficult to use?No?
      Objectives?Access to HTML elementsGeneral apps

  3. Learning outcomes